
from typing import Annotated, List, TypedDict
from typing import Any
from langchain_core.messages import BaseMessage
from langgraph.graph.message import add_messages


class AgentState(TypedDict):
    messages: Annotated[List[BaseMessage], add_messages]
    context: dict[str, Any]   # 存储上下文摘要